package com.wm.state;

/**
 * @ClassName: Context
 * @Description: 上下文
 * @Author: WM
 * @Date: 2023/5/17 9:54
 */
public class Context {
    private AbstractState state;

    public Context(AbstractState state) {
        this.state = state;
    }

    public AbstractState getState() {
        return state;
    }

    public void setState(AbstractState state) {
        this.state = state;
    }

    // 根据不同的状态执行不同的行为
    public void action() {
        this.state.action();
    }
}
